@echo off
SET  a=1
ECHO %a%
IF DEFINED a ECHO A is defined
IF NOT DEFINED a ECHO A is not defined
IF %a%==1 ECHO A is 1
Pause

SET a=a
ECHO %a%
IF DEFINED a ECHO A is defined
IF NOT DEFINED a ECHO A is not defined
IF a==a ECHO A is 1
Pause